/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.rational.sheet.table.row;

import javax.swing.AbstractListModel;
import javax.swing.JTable;

/**
 *
 * @author Overmind
 */
public class RowHeaderListModel
    extends AbstractListModel<Integer>
{
    private JTable table;

    public RowHeaderListModel(JTable table)
    {
	setTable(table);
    }
    
    public JTable getTable()
    {
	return table;
    }
    
    public final void setTable(JTable table)
    {
	this.table = table;
    }
    
    @Override
    public int getSize()
    {
	return table.getRowCount();
    }

    @Override
    public Integer getElementAt(int row)
    {
	return row + 1;
    } 
}
